import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
class FrameTest extends JFrame  implements MouseListener { 
	private Icon icon = new ImageIcon("img.png");
	private JLabel jlb = new JLabel(icon);
	public FrameTest(){
		jlb.addMouseListener(this);
		this.setLayout(null);
		this.add(jlb);
		jlb.setSize(icon.getIconWidth(),icon.getIconHeight());
		jlb.setLocation(100,200);		
		this.setSize(800,600);
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
	}		
	public void	mouseClicked(MouseEvent e){}
	public void	mouseEntered(MouseEvent e){
		int X = (int)(Math.random()*this.getWidth());
		int Y = (int)(Math.random()*this.getHeight());
		jlb.setLocation(X,Y);
	}
	public void	mouseExited(MouseEvent e){}
	public void	mousePressed(MouseEvent e){}
	public void	mouseReleased(MouseEvent e){}
	
	
	public static void main (String[] args)  {	
		new FrameTest().setVisible(true);
	}

}